import request from '@/apis/request';
import { api } from '@/config/apiBaseUrl';

const URL = {
    register: `${api}/user/register`,
    login: `${api}/user/login`,
    statPostByIndustry: `${api}/company/post/statPostByIndustry`,
    companyList: `${api}/company/company/lists?limit=9&offset=0`,
    jobList: `${api}/company/company/companypostlist`,
    resetPassword: `${api}/sys/user/resetPwds`
};

// 注册
export function register (data) {
    //  identify = users  标识用户
    // identify = companys  企业
    return request({ url: URL.register, method: 'post', data: {identify: ' users', ...data} });
}

// 登录
export function login (data) {
    return request({ url: URL.login, method: 'post', data });
}

// 行业统计
export function statPostByIndustry () {
    return request({ url: URL.statPostByIndustry});
}

// 获取公司列表 热门公司
export function companyList () {
    return request({ url: URL.companyList});
}

// 获取职位
export function getJobList () {
    return request({ url: URL.jobList});
}

// 修改密码
export function resetPassword (data) {
    return request({ url: URL.resetPassword, method: 'post', data});
}

